-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for recursion when max_proofs_verified = 1 #11698
Conversation
…th the Wrap_hack. previously this was working because we had only tested it with 2 or 0 max_proofs_verified, in which cases padding at the front or at the back are identical
Merged develop here to (hopefully) fix the nix CI failures. |
…hange some extends/trims to be on front
!ci-build-me |
!ci-build-me |
…hould be fixed so branch_data is already reversed.
!ci-build-me |
!ci-build-me |
1 similar comment
!ci-build-me |
!ci-build-me |
!ci-build-me |
@@ -619,8 +619,16 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct | |||
~f:Fn.id | |||
in | |||
let snark_work_event_subscription = | |||
Event_router.on (event_router t) Snark_work_gossip ~f:(fun _ _ -> | |||
[%log info] "Received new snark work" ; | |||
Event_router.on (event_router t) Snark_work_gossip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should revert this, since it's fairly heavy, and only for debugging.
@@ -194,6 +194,14 @@ module Make_str (_ : Wire_types.Concrete) = struct | |||
local_max_proofs_verifieds | |||
H1.T(Proof_.Messages_for_next_proof_over_same_field.Wrap).t ) = | |||
let dummy_chals = Dummy.Ipa.Wrap.challenges in | |||
let rev_magic : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should fix the iterator below and remove this. Best not to lie to the typechecker!
go M.maxes messages_for_next_wrap_proofs | ||
rev_magic | ||
(go | ||
(Obj.magic (List.rev (Obj.magic M.maxes))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise
@@ -333,7 +344,9 @@ module Make_str (_ : Wire_types.Concrete) = struct | |||
= | |||
fun rule -> | |||
let (T (_, l)) = HT.length rule.prevs in | |||
Vector.extend_exn (V.f l (M.f rule.prevs)) Max_proofs_verified.n 0 | |||
Vector.extend_front_exn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a pity that we had to reverse all of these; probably there was just one place that was wrong before. (No need to change now though, since this works as written.)
exists | ||
(Vector.typ' | ||
(Vector.map | ||
~f:(fun uses_lookup -> | ||
Unfinalized.typ ~wrap_rounds:Backend.Tock.Rounds.n | ||
~uses_lookup ) | ||
(Vector.extend lookup_usage lte Max_proofs_verified.n No) ) ) | ||
lookup_usage | ||
(* Vector.extend lookup_usage lte Max_proofs_verified.n No *) ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete
@@ -106,3 +106,10 @@ let typ ~wrap_rounds ~uses_lookup : (t, Constant.t) Typ.t = | |||
(Shifted_value.typ Other_field.typ) | |||
~assert_16_bits:(Step_verifier.assert_n_bits ~n:16) | |||
~zero:Common.Lookup_parameters.tick_zero ~uses_lookup | |||
|
|||
let dummy () : t = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: memo-ize?
This fixes a long-standing issue related to verifying proofs that have max_proofs_verified=1 via
Pickles.Proof.of_side_loaded
.The issue was that the accumulators of the proofs were being padded at the back of the list of commitments/challenges in certain parts of the code, but padded at the front of the list in others. This changes all padding to happen at the front of the list for compatibility with a sponge-state pre-computation optimization.
Previously, this bug was not uncovered because it had only been tested with max_proofs_verified= 0 or 2, in which case padding at the front and the back are identical.